home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / Tool Chest / Development Platforms / MPW Related / MPW Interfaces / PInterfaces / IntlResources.p < prev    next >
Encoding:
Text File  |  1993-09-17  |  10.9 KB  |  318 lines  |  [TEXT/MPS ]

  1. {
  2.     File:        IntlResources.p
  3.  
  4.     Copyright:    © 1983-1993 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Version:    System 7.1 for ETO #11
  8.     Created:    Tuesday, March 30, 1993 18:00
  9.  
  10. }
  11.  
  12. {$IFC UNDEFINED UsingIncludes}
  13. {$SETC UsingIncludes := 0}
  14. {$ENDC}
  15.  
  16. {$IFC NOT UsingIncludes}
  17.  UNIT IntlResources;
  18.  INTERFACE
  19. {$ENDC}
  20.  
  21. {$IFC UNDEFINED UsingIntlResources}
  22. {$SETC UsingIntlResources := 1}
  23.  
  24. {$I+}
  25. {$SETC IntlResourcesIncludes := UsingIncludes}
  26. {$SETC UsingIncludes := 1}
  27. {$IFC UNDEFINED UsingTypes}
  28. {$I $$Shell(PInterfaces)Types.p}
  29. {$ENDC}
  30. {$SETC UsingIncludes := IntlResourcesIncludes}
  31.  
  32. CONST
  33.  
  34. { Bits in the itlcFlags byte.}
  35. itlcShowIcon = 7;                                            {Show icon even if only one script}
  36. itlcDualCaret = 6;                                            {Use dual caret for mixed direction text}
  37.  
  38. { Bits in the itlcSysFlags word.}
  39. itlcSysDirection = 15;                                        {System direction - left to right/right to left}
  40.  
  41. { the NumberParts indices }
  42. tokLeftQuote = 1;
  43. tokRightQuote = 2;
  44. tokLeadPlacer = 3;
  45. tokLeader = 4;
  46. tokNonLeader = 5;
  47. tokZeroLead = 6;
  48. tokPercent = 7;
  49. tokPlusSign = 8;
  50. tokMinusSign = 9;
  51. tokThousands = 10;
  52. tokSeparator = 12;                                            {11 is a reserved field}
  53. tokEscape = 13;
  54. tokDecPoint = 14;
  55. tokEPlus = 15;
  56. tokEMinus = 16;
  57. tokMaxSymbols = 31;
  58.  
  59. curNumberPartsVersion = 1;                                    {current version of NumberParts record}
  60.  
  61. currSymLead = 16;
  62. currNegSym = 32;
  63. currTrailingZ = 64;
  64. currLeadingZ = 128;
  65.  
  66. zeroCycle = 1;                                                {0:00 AM/PM format}
  67. longDay = 0;                                                {day of the month}
  68. longWeek = 1;                                                {day of the week}
  69. longMonth = 2;                                                {month of the year}
  70. longYear = 3;                                                {year}
  71. supDay = 1;                                                    {suppress day of month}
  72. supWeek = 2;                                                {suppress day of week}
  73. supMonth = 4;                                                {suppress month}
  74. supYear = 8;                                                {suppress year}
  75. dayLdingZ = 32;
  76. mntLdingZ = 64;
  77. century = 128;
  78. secLeadingZ = 32;
  79. minLeadingZ = 64;
  80. hrLeadingZ = 128;
  81.  
  82. { Date Orders }
  83. mdy = 0;
  84. dmy = 1;
  85. ymd = 2;
  86. myd = 3;
  87. dym = 4;
  88. ydm = 5;
  89.  
  90.  
  91.  
  92. TYPE
  93.  
  94. OffPair = RECORD
  95.     offFirst: INTEGER;
  96.     offSecond: INTEGER;
  97.     END;
  98.  
  99.  
  100. OffsetTable = ARRAY [0..2] OF OffPair;
  101.  
  102.  
  103. Intl0Ptr = ^Intl0Rec;
  104. Intl0Hndl = ^Intl0Ptr;
  105. Intl0Rec = PACKED RECORD
  106.     decimalPt: CHAR;                                        {decimal point character}
  107.     thousSep: CHAR;                                            {thousands separator character}
  108.     listSep: CHAR;                                            {list separator character}
  109.     currSym1: CHAR;                                            {currency symbol}
  110.     currSym2: CHAR;
  111.     currSym3: CHAR;
  112.     currFmt: Byte;                                            {currency format flags}
  113.     dateOrder: Byte;                                        {order of short date elements: mdy, dmy, etc.}
  114.     shrtDateFmt: Byte;                                        {format flags for each short date element}
  115.     dateSep: CHAR;                                            {date separator character}
  116.     timeCycle: Byte;                                        {specifies time cycle: 0..23, 1..12, or 0..11}
  117.     timeFmt: Byte;                                            {format flags for each time element}
  118.     mornStr: PACKED ARRAY [1..4] OF CHAR;                    {trailing string for AM if 12-hour cycle}
  119.     eveStr: PACKED ARRAY [1..4] OF CHAR;                    {trailing string for PM if 12-hour cycle}
  120.     timeSep: CHAR;                                            {time separator character}
  121.     time1Suff: CHAR;                                        {trailing string for AM if 24-hour cycle}
  122.     time2Suff: CHAR;
  123.     time3Suff: CHAR;
  124.     time4Suff: CHAR;
  125.     time5Suff: CHAR;                                        {trailing string for PM if 24-hour cycle}
  126.     time6Suff: CHAR;
  127.     time7Suff: CHAR;
  128.     time8Suff: CHAR;
  129.     metricSys: Byte;                                        {255 if metric, 0 if inches etc.}
  130.     intl0Vers: INTEGER;                                        {region code (hi byte) and version (lo byte)}
  131.     END;
  132.  
  133. Intl1Ptr = ^Intl1Rec;
  134. Intl1Hndl = ^Intl1Ptr;
  135. Intl1Rec = PACKED RECORD
  136.     days: ARRAY [1..7] OF Str15;                            {day names}
  137.     months: ARRAY [1..12] OF Str15;                            {month names}
  138.     suppressDay: Byte;                                        {255 for no day, or flags to suppress any element}
  139.     lngDateFmt: Byte;                                        {order of long date elements}
  140.     dayLeading0: Byte;                                        {255 for leading 0 in day number}
  141.     abbrLen: Byte;                                            {length for abbreviating names}
  142.     st0: PACKED ARRAY [1..4] OF CHAR;                        {separator strings for long date format}
  143.     st1: PACKED ARRAY [1..4] OF CHAR;
  144.     st2: PACKED ARRAY [1..4] OF CHAR;
  145.     st3: PACKED ARRAY [1..4] OF CHAR;
  146.     st4: PACKED ARRAY [1..4] OF CHAR;
  147.     intl1Vers: INTEGER;                                        {region code (hi byte) and version (lo byte)}
  148.     localRtn: ARRAY [0..0] OF INTEGER;                        {now a flag for opt extension}
  149.     END;
  150.  
  151. UntokenTablePtr = ^UntokenTable;
  152. UntokenTableHandle = ^UntokenTablePtr;
  153. UntokenTable = RECORD
  154.     len: INTEGER;
  155.     lastToken: INTEGER;
  156.     index: ARRAY [0..255] OF INTEGER;                        {index table; last = lastToken}
  157.     END;
  158.  
  159.  
  160.  
  161. WideChar = RECORD
  162.     CASE BOOLEAN OF
  163.       TRUE:
  164.         (a: PACKED ARRAY [0..1] OF CHAR);                    {0 is the high order character}
  165.       FALSE:
  166.         (b: INTEGER);
  167.     END;
  168.  
  169. WideCharArr = RECORD
  170.     size: INTEGER;
  171.     data: PACKED ARRAY [0..9] OF WideChar;
  172.     END;
  173.  
  174. NumberPartsPtr = ^NumberParts;
  175. NumberParts = RECORD
  176.     version: INTEGER;
  177.     data: ARRAY [1..31] OF WideChar;                        {index by [tokLeftQuote..tokMaxSymbols]}
  178.     pePlus: WideCharArr;
  179.     peMinus: WideCharArr;
  180.     peMinusPlus: WideCharArr;
  181.     altNumTable: WideCharArr;
  182.     reserved: PACKED ARRAY [0..19] OF CHAR;
  183.     END;
  184.  
  185.  
  186.  
  187. Itl4Ptr = ^Itl4Rec;
  188. Itl4Handle = ^Itl4Ptr;
  189. Itl4Rec = RECORD
  190.     flags: INTEGER;                                            {reserved}
  191.     resourceType: LONGINT;                                    {contains 'itl4'}
  192.     resourceNum: INTEGER;                                    {resource ID}
  193.     version: INTEGER;                                        {version number}
  194.     resHeader1: LONGINT;                                    {reserved}
  195.     resHeader2: LONGINT;                                    {reserved}
  196.     numTables: INTEGER;                                        {number of tables, one-based}
  197.     mapOffset: LONGINT;                                        {offset to table that maps byte to token}
  198.     strOffset: LONGINT;                                        {offset to routine that copies canonical string}
  199.     fetchOffset: LONGINT;                                    {offset to routine that gets next byte of character}
  200.     unTokenOffset: LONGINT;                                    {offset to table that maps token to canonical string}
  201.     defPartsOffset: LONGINT;                                {offset to default number parts table}
  202.     resOffset6: LONGINT;                                    {reserved}
  203.     resOffset7: LONGINT;                                    {reserved}
  204.     resOffset8: LONGINT;                                    {reserved}
  205.     END;
  206.  
  207. { New NItl4Rec for System 7.0: }
  208.  
  209. NItl4Ptr = ^NItl4Rec;
  210. NItl4Handle = ^NItl4Ptr;
  211. NItl4Rec = RECORD
  212.     flags: INTEGER;                                            {reserved}
  213.     resourceType: LONGINT;                                    {contains 'itl4'}
  214.     resourceNum: INTEGER;                                    {resource ID}
  215.     version: INTEGER;                                        {version number}
  216.     format: INTEGER;                                        {format code}
  217.     resHeader: INTEGER;                                        {reserved}
  218.     resHeader2: LONGINT;                                    {reserved}
  219.     numTables: INTEGER;                                        {number of tables, one-based}
  220.     mapOffset: LONGINT;                                        {offset to table that maps byte to token}
  221.     strOffset: LONGINT;                                        {offset to routine that copies canonical string}
  222.     fetchOffset: LONGINT;                                    {offset to routine that gets next byte of character}
  223.     unTokenOffset: LONGINT;                                    {offset to table that maps token to canonical string}
  224.     defPartsOffset: LONGINT;                                {offset to default number parts table}
  225.     whtSpListOffset: LONGINT;                                {offset to white space code list}
  226.     resOffset7: LONGINT;                                    {reserved}
  227.     resOffset8: LONGINT;                                    {reserved}
  228.     resLength1: INTEGER;                                    {reserved}
  229.     resLength2: INTEGER;                                    {reserved}
  230.     resLength3: INTEGER;                                    {reserved}
  231.     unTokenLength: INTEGER;                                    {length of untoken table}
  232.     defPartsLength: INTEGER;                                {length of default number parts table}
  233.     whtSpListLength: INTEGER;                                {length of white space code list}
  234.     resLength7: INTEGER;                                    {reserved}
  235.     resLength8: INTEGER;                                    {reserved}
  236.     END;
  237.  
  238. TableDirectoryRecord = RECORD
  239.     tableSignature: OSType;                                    {4 byte long table name }
  240.     reserved: LONGINT;                                        {Reserved for internal use }
  241.     tableStartOffset: LONGINT;                                {Table start offset in byte}
  242.     tableSize: LONGINT;                                        {Table size in byte}
  243.     END;
  244.  
  245. Itl5Record = RECORD
  246.     versionNumber: Fixed;                                    {itl5 resource version number }
  247.     numberOfTables: INTEGER;                                {Number of tables it contains }
  248.     reserved: ARRAY [0..2] OF INTEGER;                        {Reserved for internal use }
  249.     tableDirectory: ARRAY [0..0] OF TableDirectoryRecord;    {Table directory records }
  250.     END;
  251.  
  252. RuleBasedTrslRecord = RECORD
  253.     sourceType: INTEGER;                                    {Transliterate target type for the LHS of the rule }
  254.     targetType: INTEGER;                                    {Transliterate target type for the RHS of the rule }
  255.     formatNumber: INTEGER;                                    {Transliterate resource format number }
  256.     propertyFlag: INTEGER;                                    {Transliterate property flags }
  257.     numberOfRules: INTEGER;                                    {Number of rules following this field }
  258.     END;
  259.  
  260.  
  261.  
  262. ItlcRecord = RECORD
  263.     itlcSystem: INTEGER;                                    {default system script}
  264.     itlcReserved: INTEGER;                                    {reserved}
  265.     itlcFontForce: SignedByte;                                {default font force flag}
  266.     itlcIntlForce: SignedByte;                                {default intl force flag}
  267.     itlcOldKybd: SignedByte;                                {MacPlus intl keybd flag}
  268.     itlcFlags: SignedByte;                                    {general flags}
  269.     itlcIconOffset: INTEGER;                                {keyboard icon offset; not used in 7.0}
  270.     itlcIconSide: SignedByte;                                {keyboard icon side; not used in 7.0}
  271.     itlcIconRsvd: SignedByte;                                {rsvd for other icon info}
  272.     itlcRegionCode: INTEGER;                                {preferred verXxx code}
  273.     itlcSysFlags: INTEGER;                                    {flags for setting system globals}
  274.     itlcReserved4: ARRAY [0..31] OF SignedByte;                {for future use}
  275.     END;
  276.  
  277. ItlbRecord = RECORD
  278.     itlbNumber: INTEGER;                                    {itl0 id number}
  279.     itlbDate: INTEGER;                                        {itl1 id number}
  280.     itlbSort: INTEGER;                                        {itl2 id number}
  281.     itlbFlags: INTEGER;                                        {Script flags}
  282.     itlbToken: INTEGER;                                        {itl4 id number}
  283.     itlbEncoding: INTEGER;                                    {itl5 ID # (optional; char encoding)}
  284.     itlbLang: INTEGER;                                        {current language for script }
  285.     itlbNumRep: SignedByte;                                    {number representation code}
  286.     itlbDateRep: SignedByte;                                {date representation code }
  287.     itlbKeys: INTEGER;                                        {KCHR id number}
  288.     itlbIcon: INTEGER;                                        {ID # of SICN or kcs#/kcs4/kcs8 suite.}
  289.     END;
  290.  
  291. { New ItlbExtRecord structure for System 7.0 }
  292.  
  293. ItlbExtRecord = RECORD
  294.     base: ItlbRecord;                                        {un-extended ItlbRecord}
  295.     itlbLocalSize: LONGINT;                                    {size of script's local record}
  296.     itlbMonoFond: INTEGER;                                    {default monospace FOND ID}
  297.     itlbMonoSize: INTEGER;                                    {default monospace font size}
  298.     itlbPrefFond: INTEGER;                                    {preferred FOND ID}
  299.     itlbPrefSize: INTEGER;                                    {preferred font size}
  300.     itlbSmallFond: INTEGER;                                    {default small FOND ID}
  301.     itlbSmallSize: INTEGER;                                    {default small font size}
  302.     itlbSysFond: INTEGER;                                    {default system FOND ID}
  303.     itlbSysSize: INTEGER;                                    {default system font size}
  304.     itlbAppFond: INTEGER;                                    {default application FOND ID}
  305.     itlbAppSize: INTEGER;                                    {default application font size}
  306.     itlbHelpFond: INTEGER;                                    {default Help Mgr FOND ID}
  307.     itlbHelpSize: INTEGER;                                    {default Help Mgr font size}
  308.     itlbValidStyles: Style;                                    {set of valid styles for script}
  309.     itlbAliasStyle: Style;                                    {style (set) to mark aliases}
  310.     END;
  311.  
  312. {$ENDC} { UsingIntlResources }
  313.  
  314. {$IFC NOT UsingIncludes}
  315.     END.
  316. {$ENDC}
  317.  
  318.